package test.company;

import java.util.Scanner;

public class ConpanyText {
    public static void main(String[] args) {
        Company n = Company.get();
        if (n == null) {
            System.out.println("新公司成立！");
            n = new Company("北大青鸟", "11111111", "长江中路");
        }
        System.out.println("这个公司是" + n.name + "联系方式" + n.phone + "地址是" + n.address);
        System.out.println("进入员工系统");
        Scanner input = new Scanner(System.in);
        while (true) {
            System.out.println("1.招聘新员工，2.查询员工信息，3.辞退员工请选择,4查找最高薪水,5.薪水排序，9：退出");
            int choice = input.nextInt();
            if (choice == 1) {
                Yuangong m = new Yuangong();
                System.out.println("请输入员工姓名");
                m.name = input.next();
                System.out.println("请输入员工工号");
                m.no = input.nextInt();
                System.out.println("请输入员工性别");
                m.sex = input.next();
                System.out.println("请输入员工年纪");
                m.age = input.nextInt();
                System.out.println("请输入员工岗位");
                m.job = input.next();
                System.out.println("请输入员工薪水");
                m.xinshui = input.nextInt();
                n.add(m);
            }
            if (choice == 2) {
                n.show1();
            }
            if (choice == 3) {
                //Yuangong m = new Yuangong();
                System.out.println("输入辞去员工工号");
                int no = input.nextInt();
                n.citui(no);
            }
            if (choice == 4) {
                Yuangong topSalary = n.findTopSalary();
                topSalary.show();
            }
            if (choice == 5) {
                n.sortBySalDesc();
            }
            if (choice ==9) {
                Company.store(n);
                return;
            }

        }


    }
}
